package org.boot.wxipad.support.bean.friend;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.boot.wxipad.common.util.json.WxIpadGsonBuilder;
import org.boot.wxipad.support.bean.WxIpadBaseResp;

/**
 * @author liyuncong
 * @version 1.0
 * @file WxIpadAddFriendResp
 * @brief 微信IPAD添加好友响应
 * @details 微信IPAD添加好友响应
 * @date 2024-08-05
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                     NAME               DESCRIPTION
 * 2024-08-05               liyuncong          Created
 */

@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class WxIpadAddFriendResp extends WxIpadBaseResp {

    private WxFriendInfo data;

    public boolean isNotFount() {
        return !this.success && this.status == 400 && this.msg.equals("用户不存在");
    }

    public static WxIpadAddFriendResp fromJson(String json) {
        return WxIpadGsonBuilder.create().fromJson(json, WxIpadAddFriendResp.class);
    }

    @AllArgsConstructor
    @NoArgsConstructor
    @Getter
    @Setter
    public static class WxFriendInfo {
        private Integer verifyFlag;
        private Integer msgType;
        private Integer chatroomVersion;
        private String ticket;
        private String nickName;
        private Integer sex;
        private Integer contactType;
        private Integer type;
        private String userName;
        private String bigHeadImgUrl;
        private String encryptUsername;
    }
}
